<?php
include('connect.php');

$con=Conectarse();

$sql_query = 'SELECT * FROM libros WHERE '.$_POST["criteria"].' like "%'.$_POST["value"].'%"';

$result = mysql_query($sql_query);

?>
<html>
<head>
	<title>REDES-PHP</title>
</head>
<body>
<h1>Listado de libros</h1>
<ul>
<?php
	while ($data = mysql_fetch_assoc($result)) {
?>
	<li>
<?php
		echo "Libro:" . $data["Titulo"] . " (";
		echo "ISBN: " . $data["ISBN"] . ") ";
		echo "Autor: " . $data["Autor"] . " - ";
		echo "Editorial: ". $data["Editorial"] . " - ";
		echo "Precio: " . $data["Precio"] ;
?>
	</li>
<?php
	}
	
	mysql_free_result($result);
	mysql_close($con);
	
?>
</ul>

</body>
</html>

